Optimal. Leaf size=182 \[ \frac {2 \left (5 a^2 A+3 A b^2+6 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (5 b^2 B+7 a (2 A b+a B)\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}+\frac {2 \left (5 b^2 B+7 a (2 A b+a B)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 b (7 A b+9 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 182, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3069, 3102,
2827, 2719, 2715, 2720} \begin {gather*} \frac {2 \left (5 a^2 A+6 a b B+3 A b^2\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (7 a (a B+2 A b)+5 b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}+\frac {2 \left (7 a (a B+2 A b)+5 b^2 B\right ) \sin (c+d x) \sqrt {\cos (c+d x)}}{21 d}+\frac {2 b (9 a B+7 A b) \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x)}{35 d}+\frac {2 b B \sin (c+d x) \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x))}{7 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2715
Rule 2719
Rule 2720
Rule 2827
Rule 3069
Rule 3102
Rubi steps
\begin {align*} \int \sqrt {\cos (c+d x)} (a+b \cos (c+d x))^2 (A+B \cos (c+d x)) \, dx &=\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d}+\frac {2}{7} \int \sqrt {\cos (c+d x)} \left (\frac {1}{2} a (7 a A+3 b B)+\frac {1}{2} \left (5 b^2 B+7 a (2 A b+a B)\right ) \cos (c+d x)+\frac {1}{2} b (7 A b+9 a B) \cos ^2(c+d x)\right ) \, dx\\ &=\frac {2 b (7 A b+9 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d}+\frac {4}{35} \int \sqrt {\cos (c+d x)} \left (\frac {7}{4} \left (5 a^2 A+3 A b^2+6 a b B\right )+\frac {5}{4} \left (5 b^2 B+7 a (2 A b+a B)\right ) \cos (c+d x)\right ) \, dx\\ &=\frac {2 b (7 A b+9 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d}+\frac {1}{5} \left (5 a^2 A+3 A b^2+6 a b B\right ) \int \sqrt {\cos (c+d x)} \, dx+\frac {1}{7} \left (5 b^2 B+7 a (2 A b+a B)\right ) \int \cos ^{\frac {3}{2}}(c+d x) \, dx\\ &=\frac {2 \left (5 a^2 A+3 A b^2+6 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (5 b^2 B+7 a (2 A b+a B)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 b (7 A b+9 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d}+\frac {1}{21} \left (5 b^2 B+7 a (2 A b+a B)\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (5 a^2 A+3 A b^2+6 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d}+\frac {2 \left (5 b^2 B+7 a (2 A b+a B)\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{21 d}+\frac {2 \left (5 b^2 B+7 a (2 A b+a B)\right ) \sqrt {\cos (c+d x)} \sin (c+d x)}{21 d}+\frac {2 b (7 A b+9 a B) \cos ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{35 d}+\frac {2 b B \cos ^{\frac {3}{2}}(c+d x) (a+b \cos (c+d x)) \sin (c+d x)}{7 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.19, size = 139, normalized size = 0.76 \begin {gather*} \frac {42 \left (5 a^2 A+3 A b^2+6 a b B\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+10 \left (14 a A b+7 a^2 B+5 b^2 B\right ) F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+\sqrt {\cos (c+d x)} \left (42 b (A b+2 a B) \cos (c+d x)+5 \left (28 a A b+14 a^2 B+13 b^2 B+3 b^2 B \cos (2 (c+d x))\right )\right ) \sin (c+d x)}{105 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(547\) vs.
\(2(218)=436\).
time = 0.32, size = 548, normalized size = 3.01
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (240 B \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+\left (-168 A \,b^{2}-336 B a b -360 B \,b^{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (280 A a b +168 A \,b^{2}+140 B \,a^{2}+336 B a b +280 B \,b^{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+\left (-140 A a b -42 A \,b^{2}-70 B \,a^{2}-84 B a b -80 B \,b^{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+70 A a b \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-105 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a^{2}-63 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) b^{2}+35 B \,a^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+25 B \,b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-126 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) a b \right )}{105 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(548\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.14, size = 243, normalized size = 1.34 \begin {gather*} \frac {2 \, {\left (15 \, B b^{2} \cos \left (d x + c\right )^{2} + 35 \, B a^{2} + 70 \, A a b + 25 \, B b^{2} + 21 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 5 \, \sqrt {2} {\left (7 i \, B a^{2} + 14 i \, A a b + 5 i \, B b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 \, \sqrt {2} {\left (-7 i \, B a^{2} - 14 i \, A a b - 5 i \, B b^{2}\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 21 \, \sqrt {2} {\left (-5 i \, A a^{2} - 6 i \, B a b - 3 i \, A b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 21 \, \sqrt {2} {\left (5 i \, A a^{2} + 6 i \, B a b + 3 i \, A b^{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{105 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.34, size = 229, normalized size = 1.26 \begin {gather*} \frac {2\,B\,a^2\,\left (\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )+\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )\right )}{3\,d}+\frac {2\,A\,a^2\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,A\,a\,b\,\left (\frac {2\,\sqrt {\cos \left (c+d\,x\right )}\,\sin \left (c+d\,x\right )}{3}+\frac {2\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{3}\right )}{d}-\frac {2\,A\,b^2\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {2\,B\,b^2\,{\cos \left (c+d\,x\right )}^{9/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {9}{4};\ \frac {13}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{9\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}}-\frac {4\,B\,a\,b\,{\cos \left (c+d\,x\right )}^{7/2}\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{2},\frac {7}{4};\ \frac {11}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{7\,d\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________